<?php
class Nav_model extends CI_Model {
	var $nav_view;
	var $href_new;

	function __construct()
    {
        // Call the Model constructor
        parent::__construct();

	}

	function get_nav($sel='')
	{
		$nav_array = array('top'=>'名站导航','main'=>'分类导航','main_url'=>'分类导航URL','sidebar'=>'边栏','sidebar_url'=>'边栏URL');
		$nav_view = '<ul id="mainNav">';

		foreach($nav_array as $href=>$nav_name)
		{
			//$href_new = base_url().$href;
			$href_new = site_url($href);

			if($nav_name == $sel)
				$nav_view .= '<li><a href="'.$href_new.'" id="selected">'.$nav_name.'</a></li>';
			else
				$nav_view .= '<li><a href="'.$href_new.'">'.$nav_name.'</a></li>';
		}

	   $nav_view .= '</ul>';

		return $nav_view;
	}


}